package cpa.prowon.gui;

import java.util.Collection;

import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.Viewer;

import pho.prowon.category.VisibleIndexCategory;


/**
 * The picture list content provider provides the information needed to display
 * the detailed picture list
 * @author Chris
 */
public class PictureListContentProvider implements IStructuredContentProvider {

	/**
	 * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(Object)
	 */
	public Object[] getElements(Object element) {
		
		// Return the images of the index category, if none are available return an empty array
		Collection il = ((VisibleIndexCategory) element).getImages();
		if (il.isEmpty() == false)
		{
			return il.toArray();
		}
		return new Object[0];
		
	}

	/**
	 * @see org.eclipse.jface.viewers.IContentProvider#dispose()
	 */
	public void dispose() {
	}

	/**
	 * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(Viewer, Object, Object)
	 */
	public void inputChanged(Viewer arg0, Object arg1, Object arg2) {
	}

}
